<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateStatOcpcVivoTable extends Migration
{
    protected $connection = 'stat';
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('stat_ocpc_vivo', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->date('day')->comment('天');
            $table->unsignedInteger('register_user')->default(0)->comment('当天注册人数');
            $table->unsignedInteger('reg_recharge_user')->default(0)->comment('当天注册并充值人数');
            $table->unsignedInteger('reg_recharge_num')->default(0)->comment('当天注册并充值次数');
            $table->unsignedInteger('reg_recharge_money')->default(0)->comment('当天注册并充值金额 单位：分');
            $table->unsignedInteger('recharge_user')->default(0)->comment('当天充值人数');
            $table->unsignedInteger('recharge_money')->default(0)->comment('当天充值金额 单位：分');
            $table->unsignedInteger('recharge_num')->default(0)->comment('当天充值次数');
            $table->string('package_name',30)->default('')->comment('包名');
            $table->timestamps();
            $table->comment('vivo回传统计');
            $table->index('day','idx_d');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('stat_ocpc_vivo');
    }
}
